package cn.hellochaos.generator.service;

import cn.hellochaos.generator.entity.CaipuZhuliao;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

/**
* <p>
* 主料 服务类
* </p>
*
* @author test
* @since 2021-01-23
*/
public interface CaipuZhuliaoService {

    /**
    * 分页查询CaipuZhuliao
    *
    * @param page     当前页数
    * @param pageSize 页的大小
    * @param factor  搜索关键词
    * @return 返回mybatis-plus的Page对象,其中records字段为符合条件的查询结果
    * @author test
    * @since 2021-01-23
    */
    Page<CaipuZhuliao> listCaipuZhuliaosByPage(int page, int pageSize, String factor);

    /**
    * 根据id查询CaipuZhuliao
    *
    * @param id 需要查询的CaipuZhuliao的id
    * @return 返回对应id的CaipuZhuliao对象
    * @author test
    * @since 2021-01-23
    */
    CaipuZhuliao getCaipuZhuliaoById(int id);

    /**
    * 插入CaipuZhuliao
    *
    * @param caipuZhuliao 需要插入的CaipuZhuliao对象
    * @return 返回插入成功之后CaipuZhuliao对象的id
    * @author test
    * @since 2021-01-23
    */
    int insertCaipuZhuliao(CaipuZhuliao caipuZhuliao);

    /**
    * 根据id删除CaipuZhuliao
    *
    * @param id 需要删除的CaipuZhuliao对象的id
    * @return 返回被删除的CaipuZhuliao对象的id
    * @author test
    * @since 2021-01-23
    */
    int deleteCaipuZhuliaoById(int id);

    /**
    * 根据id更新CaipuZhuliao
    *
    * @param caipuZhuliao 需要更新的CaipuZhuliao对象
    * @return 返回被更新的CaipuZhuliao对象的id
    * @author test
    * @since 2021-01-23
    */
    int updateCaipuZhuliao(CaipuZhuliao caipuZhuliao);

    List<CaipuZhuliao> getCaipuBuzhouByCookBookId(Integer caipuBookId);
}
